package com.shelpe.services.algorithm.semiauto;

import org.springframework.stereotype.Service;

import com.shelpe.services.algorithm.controller.SemiautoController.Keyword;
import com.shelpe.services.algorithm.repository.dto.semiauto.SemiautoCondition;

import lombok.extern.slf4j.Slf4j;

@Service
@Slf4j
public class QscoreSemiautoFilter implements SemiautoFilter {

	@Override
	public boolean support(SemiautoCondition condition) {
		return "qscore".equals(condition.getName());
	}

	@Override
	public boolean filter(Keyword word, SemiautoCondition condition) {
		log.debug("qscore is selected: {}", word);
		return condition.runCondition(word.getQscore());
	}

}
